Hack Name: Harry Potter Manual House Selection v1.0

Author: WormHole @ XMB Garage

Based on House Selection (Harry Potter) v1.0 by: GuldantheWarlock (GuldantheWarlock@xmbgarage.com)

Description:
This hack will add a selection box to allow users to select a school to join on the message board.
It comes with the Harry Potter default options of: Beauxbatons, Durmstrang and Hogwarts.
This hack will show this selection in both profiles and posts.

Supported Version: XMB 1.9.5 Nexus Final

Notes:

This hack is released under the GPL. You should have recieved a copy of it with this hack.

Please backup your files before installing this mod. Neither XMBGarage nor the author can be held 
responsible if your board stops functioning properly due to you installing this hack.

=======================================================================================================

=======
Step 1:
=======

===================================
Go To Admin Panel -> Insert Raw SQL
===================================

========================================
Paste the following code and hit submit:
========================================

ALTER TABLE `$table_members` ADD `school` varchar(100) NOT NULL default '';

=======================================================================================================

=======
Step 2:
=======

===========================
Edit lang/English.lang.php:
===========================

=====
Find:
=====

================
Add To End Of File:
================

// School Selection Mod Begin
$lang['schoolselection1'] = "School:";
$lang['schoolselection2'] = "School Selection:";
$lang['schoolselection3'] = "Select School...";
$lang['schoolselection4'] = "You must select a School before registering!";
$lang['school1name'] = "Beauxbatons";
$lang['school2name'] = "Durmstrang";
$lang['school3name'] = "Hogwarts";
// School Selection Mod End

=======================================================================================================

=======
Step 3:
=======

=====================
Edit editprofile.php:
=====================

=====
Find:
=====

    $eouchecked = '';
    if ( $member['emailonu2u'] == 'yes' )
    {
        $eouchecked = $cheHTML;
    }
    
==========
Add Below:
==========
    
    // School Selection Mod Begin
    $school1sel = $school2sel = $school3sel = '';
    if ( $member['school'] == $lang['school1name']) {
        $school1sel = $selHTML;
    } elseif ( $member['school'] == $lang['school2name']) {
        $school2sel = $selHTML;
    } elseif ( $member['school'] == $lang['school3name']) {
        $school3sel = $selHTML;
    }
    // School Selection Mod End
    
=====
Find:
=====

    $db->query("UPDATE $table_members SET email='$email'
    
==========================================================
Add to end of statement BEFORE 'WHERE username='$user'");':
==========================================================

, school='$newschool'

=======================================================================================================

=======
Step 4:
=======

================
Edit member.php:
================

=====
Find:
=====

        $db->query("INSERT INTO $table_members (
        
==========
Add Above:
==========

        // School Selection Mod Begin
        if (!isset($school) && empty($school)) {
            error($lang['schoolselection4']);
        }
        // School Selection Mod End

=====
Find:
=====

        $db->query("INSERT INTO $table_members (
        
=====================================
Add to line just before ') VALUES (':
=====================================

, school

===========================================
Add to end of statement just before ')");':
===========================================

, '$school'

=====
Find:
=====

            if ($memberinfo['showemail'] == "yes") {
                eval("\$emailblock = \"".template("member_profile_email")."\";");
            } else {
                $emailblock = '';
            }
          
==========  
Add Below:
==========

            // School Selection Mod Begin
            if ($memberinfo['school'] != '') {
                $memberschool = ".$memberinfo['school'];
            } else {
                $memberschool = 'None';
            }
            // School Selection Mod End

=======================================================================================================

=======
Step 5:
=======

====================
Edit viewthread.php:
====================

=====
Find:
=====

            if ($post['location'] != '') {
                $post['location'] = censor($post['location']);
                $location = '<br />'.$lang['textlocation'].' '.$post['location'];
            } else {
                $location = '';
            }
            
==========
Add Below:
==========

            // School Selection Mod Begin
            if ($post['school'] != '') {
                $school = "<br />".$lang['schoolselection1']."  ".$post['school'];
            } else {
                $school = '';
            }
            // School Selection Mod End

=====
Find:
=====

            $mood = '';
            
==========
Add Below:
==========

            // School Selection Mod Begin
            $school = '';
            // School Selection Mod End

=======================================================================================================

=======
Step 6:
=======

===============
Edit memcp.php:
===============

=====
Find:
=====

        eval("\$profile = \"".template("memcp_profile")."\";");
        $profile = stripslashes($profile);
        echo $profile;

==========
Add Above:
==========

        // School Selection Mod Begin
        $schoolsel = '';
        if ($member['school'] == '') {
            $schoolsel   = array();
            $schoolsel[] = "<tr>\n<td bgcolor=\"$altbg1\" width=\"22%\" class=\"tablerow\">$lang[schoolselection2]</td>\n<td bgcolor=\"$altbg2\" class=\"tablerow\"><select name=\"newschool\">";
            $schoolsel[] = "<option value=\"\" selected=\"selected\">$lang[schoolselection3]</option>";
            $schoolname  = '';
            for ($i=1;$i<=4;$i++) {
                $schoolname  = "school".$i."name";
                $schoolsel[] = "<option value=\"$lang[$schoolname]\">$lang[$schoolname]</option>";
            }
            $schoolsel[] = "</select>\n</td>\n</tr>";
            $schoolsel   = implode("\n", $schoolsel);
        }
        // School Selection Mod End

=====
Find:
=====

        $db->query("UPDATE $table_members SET $pwtxt

==========
Add Above:
==========

        // School Selection Mod Begin
        if ($newschool != '') {
            $schoolupdate = "school='$newschool',";
        } else {
            $schoolupdate = '';
        }
        // School Selection Mod End

=====
Find:
=====

        $db->query("UPDATE $table_members SET

=============
Find in line:
=============

$pwtxt

=============
Replace With:
=============

$pwtxt $schoolupdate

========================================================================================================

=======
Step 7:
=======

=======================================
Go to Administration Panel -> Templates
=======================================

=====================================
Edit Template: admintool_editprofile:
=====================================

=====
Find:
=====

<tr>
<td bgcolor="$altbg1" width="22%" class="tablerow">$lang[textemail]</td>
<td bgcolor="$altbg2" class="tablerow"><input type="text" name="newemail" size="25" value="$member[email]" /><br /><a href="http://www.network-tools.com/default.asp?prog=validate&amp;Netnic=whois.arin.net&amp;host=$member[email]" target="_blank">$lang[adminverifyemail]</a></td>
</tr>

==========
Add Below:
==========

<tr>
<td bgcolor="$altbg1" width="22%" class="tablerow">$lang[schoolselection2]</td>
<td bgcolor="$altbg2" class="tablerow"><select name="newschool">
<option value="">$lang[schoolselection3]</option>
<option value="$lang[school1name]" $school1sel>$lang[school1name]</option>
<option value="$lang[school2name]" $school2sel>$lang[school2name]</option>
<option value="$lang[school3name]" $school3sel>$lang[school3name]</option>
</select></td>
</tr>

=======================================================================================================

=======
Step 8:
=======

=======================================
Go to Administration Panel -> Templates
=======================================

==============================
Edit Template: member_profile:
==============================

=====
Find:
=====

<tr>
<td bgcolor="$altbg1" class="tablerow" valign="top">$lang[textstatus]<br /><a href="$sitelink" target="_blank">$memberinfo[avatar]</a></td>
<td bgcolor="$altbg2" class="tablerow">$showtitle$customstatus<br />$stars<br /><br />$rank[avatarrank]</td>
</tr>

==========
Add Below:
==========

<tr>
<td bgcolor="$altbg1" valign="top" class="tablerow">$lang[schoolselection1]</td>
<td bgcolor="$altbg2" class="tablerow">$memberschool</td>
</tr>

=======================================================================================================

=======
Step 9:
=======

=======================================
Go to Administration Panel -> Templates
=======================================

==========================
Edit Template: member_reg:
==========================

=====
Find:
=====

<tr>
<td bgcolor="$altbg1" class="tablerow" width="22%">$lang[textemail]</td>
<td bgcolor="$altbg2" class="tablerow"><input type="text" name="email" size="25" /></td>
</tr>

==========
Add Below:
==========

<tr>
<td bgcolor="$altbg1" width="22%" class="tablerow">$lang[schoolselection2]</td>
<td bgcolor="$altbg2" class="tablerow"><select name="school">
<option value="" selected="selected">$lang[schoolselection3]</option>
<option value="$lang[school1name]">$lang[school1name]</option>
<option value="$lang[school2name]">$lang[school2name]</option>
<option value="$lang[school3name]">$lang[school3name]</option>
</select></td>
</tr>

=======================================================================================================

========
Step 10:
========

=======================================
Go to Administration Panel -> Templates
=======================================

==========================
Edit Template: memcp_home:
==========================

=====
Find:
=====

<tr class="tablerow">
<td bgcolor="$altbg1" valign="top">$lang[textcusstatus]</td>
<td bgcolor="$altbg2" valign="top">$member[customstatus]</td>
<td bgcolor="$altbg1" valign="top">&nbsp;</td>
<td bgcolor="$altbg2" valign="top">&nbsp;</td>
<td bgcolor="$altbg1" valign="top">&nbsp;</td>
<td bgcolor="$altbg2" valign="top">&nbsp;</td>
</tr>

=============
Replace With:
=============

<tr class="tablerow">
<td bgcolor="$altbg1" valign="top">$lang[textcusstatus]</td>
<td bgcolor="$altbg2" valign="top">$member[customstatus]</td>
<td bgcolor="$altbg1" valign="top">$lang[schoolselection1]</td>
<td bgcolor="$altbg2" valign="top">$member[house]</td>
<td bgcolor="$altbg1" valign="top">&nbsp;</td>
<td bgcolor="$altbg2" valign="top">&nbsp;</td>
</tr>

=======================================================================================================

========
Step 11:
========

=======================================
Go to Administration Panel -> Templates
=======================================

===============================
Edit Template: veiwthread_post:
===============================

=====
Find:
=====

$location

==========
Add Below:
==========

$school

=======================================================================================================

========
Step 12:
========

=======================================
Go to Administration Panel -> Templates
=======================================

=============================
Edit Template: memcp_profile:
=============================

=====
Find:
=====

<tr>
<td bgcolor="$altbg1" width="22%" class="tablerow">$lang[textemail]</td>
<td bgcolor="$altbg2" class="tablerow"><input type="text" name="newemail" size="25" value="$member[email]" /></td>
</tr>

==========
Add Below:
==========

$schoolsel

=======================================================================================================

Upload all edited files and enjoy!